import login from './index'



let reducer = (state = { ...login.state }, action: {type: string, value: string | number}) => {
    let newState = JSON.parse(JSON.stringify(state))
    for(let key in login.actionsName) {
        if(action.type === login.actionsName[key]) {
            login.actions[login.actionsName[key]](newState, action.value)
        }
    }
    return newState
}


export default reducer